<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:view>
	<h:head>
		<p:resources />
		<title>Cadastro de Laboratorio</title>
	</h:head>
<body>
	
	
	
	<h:form prependId="false" >
		
		<p:messages id="msgs" showDetail="true"/>
		
		<p:panel header="Laboratorio" id="panelDadosPessoais">
			<h:panelGrid columns="2" columnClasses="label, value"
				styleClass="grid">
				<h:outputLabel id="labelNome" for="nome" value="Laboratorio* " />
				<p:inputText id="nome" value="#{laboratorioBean.laboratorio.nome}" 
					required="true"/>

				<h:outputLabel id="labelCNPJ" for="cnpj" value="CNPJ* " />
				<p:inputMask id="cnpj" value="#{laboratorioBean.laboratorio.cnpj}"
					mask="99.999.999/9999-99">
					<f:converter converterId="farmaciaweb.com.br.CnpjConverter" />					
				</p:inputMask>				
				
				<h:outputLabel id="labelLogradouro" for="logradouro" value="Logradouro* "/>
				<p:inputText id="logradouro"  value="#{laboratorioBean.laboratorio.endereco}"/>
				
				<h:outputLabel id="labelEmail" for="logradouro" value="Email* "/>
				<p:inputText id="email"  value="#{laboratorioBean.laboratorio.email}"/>
				
				<h:outputLabel id="labelSite" for="site" value="Site "/>
				<p:inputText id="site"  value="#{laboratorioBean.laboratorio.homepage}"/>
				
				<h:outputLabel id="labelTel" for="tel"
					value="Telefone" />
				<p:inputMask id="telRes" value="#{laboratorioBean.laboratorio.telefone}"
					mask="(99) 9999-9999">
					<f:converter converterId="farmaciaweb.com.br.TelefoneConverter" />
				</p:inputMask>
				
			</h:panelGrid>
		</p:panel>
		
		<p:commandButton value="Salvar" ajax="false"
	   			actionListener="#{laboratorioBean.salvarLaboratorio}" />
	   	<p:commandButton action="#{laboratorioBean.irParaConsultarLaboratorio}" value="Voltar"
						immediate="true" ajax="false" />	   			   
	</h:form>
</body>
</f:view>
</html>

